ViewerEngineListener not tracking disconnects#72
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughViewerEngineListener adds a disconnect callback that removes a disconnected user from tracked entity viewer lists, with imports for ChangesDisconnect handling
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@api/src/main/java/me/tofaa/entitylib/ve/ViewerEngineListener.java`:
- Around line 86-101: Route the disconnect cleanup in
ViewerEngineListener.onUserDisconnect through engine.getExecutor() instead of
mutating viewer state inline. The current loop over engine.getTracked0() and
calls to entity.removeViewer(uniqueId) should be executed on the same serialized
path used by ViewerEngine for tracking work. Keep the null uniqueId guard, but
move the viewer-removal logic into the executor callback so it does not race
with other WrapperEntity mutations.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 0e6df4cb-9f25-45db-bfaf-672ddbed665d
📒 Files selected for processing (1)
api/src/main/java/me/tofaa/entitylib/ve/ViewerEngineListener.java
|
LGTM |
The ViewerEngineListener wouldn't track player disconnects. If the player disconnects without unloading the chunk, Entities would think that the Viewer is still there. Then, when you relog, you can't see the entity until you unload and reload the chunk.
Summary by CodeRabbit